//
// GM_EXPORT double GetPerlin
//    size
//    int dOctaves
//    float dFreq
//    float dAmp
//    int dSeed 
// Returns a square grid of perlin
//
noiseObject = NshCreatePerlin( choose( 3,4,5,6 ), 4, 1, round( random( 32000 ) ) );

for ( i = 0; i < ds_grid_width( myGrid ); i += 1 )
{
    for ( j = 0; j < ds_grid_height( myGrid ); j += 1 )
    {
        ds_grid_set( myGrid, i,j, NshGetPerlin( noiseObject, i/ds_grid_width( myGrid ), j/ds_grid_height( myGrid )) );
    }
}
/*noiseObject = NshCreatePerlin( argument2, argument3, argument4, argument5 );
hMap = ds_grid_create( argument0, argument1 );
for ( i = 0; i < ds_grid_width( hMap ); i += 1 )
{
    for ( j = 0; j < ds_grid_height( hMap ); j += 1 )
    {
        ds_grid_set( hMap, i,j, NshGetPerlin( noiseObject, i/ds_grid_width( hMap ), j/ds_grid_height( hMap )) );
    }
}

return hMap
